home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9811 < prev    next >
Encoding:
Text File  |  1996-08-05  |  798 b   |  35 lines

  1. Path: crl.crl.com!not-for-mail
  2. From: dbridges@crl.com (Dick Bridges)
  3. Newsgroups: comp.lang.c++
  4. Subject: [Q] namespace #1
  5. Date: 4 Mar 1996 09:07:55 -0800
  6. Organization: CRL Network Services      (415) 705-6060  [Login: guest]
  7. Message-ID: <4hf81b$aov@crl.crl.com>
  8. NNTP-Posting-Host: crl.com
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. #include <iostream.h>
  12.  
  13. namespace foo
  14. {
  15.     int Value = 43;
  16. };
  17.  
  18. void main()
  19. {
  20.     int Value = 65;
  21.     using namespace foo;
  22.     cout << Value << endl;
  23. }
  24.  
  25. // QUESTIONS:
  26. // 1) Is this a valid program
  27. // 2) If so what is the expected output, if not what is the error
  28. // 3) What would be the result of using a using declaration instead
  29. //    instead of a using directive
  30. //
  31. // NOTES:
  32. // 1) The Microsoft VC++ 4.0 compiler complains that Value is an
  33. //    ambiguous symbol. Is this correct?
  34.  
  35.